from queue import Queue
import time
from threading import Thread

list = [1, 1, 4, 5, 6, 7, 8, 8]
test_queue = Queue()

def put_queue_nums():
    for item in list:
        test_queue.put(item)


def get_queque_nums():
    while True:
        if test_queue.empty():
            break
        num = test_queue.get()
        print(num)


put_queue_thread = Thread(target=put_queue_nums)
get_queue_thread = Thread(target=get_queque_nums)

if __name__ == "__main__":

    put_queue_thread.start()
    get_queue_thread.start()